]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st/texture-cache: Fix invalid memory write related to X11 window icons
authorSebastian Keller <skeller@gnome.org>
Mon, 9 Mar 2020 01:17:19 +0000 (02:17 +0100)
committerFlorian Müllner <florian.muellner@gmail.com>
Mon, 9 Mar 2020 17:34:56 +0000 (17:34 +0000)
st_texture_cache_bind_weak_notify calls g_clear_signal_handler which
then calls st_texture_cache_free_bind. st_texture_cache_free_bind frees
the bind structure, so by the time g_clear_signal_handler tries to write
bind->notify_signal_id, bind has already been freed.

Fix this by using g_signal_handler_disconnect instead.

This partially reverts 135d178d08

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/2334

src/st/st-texture-cache.c

index 758c0215f5bc09079885aaf0a10e473e9f182e17..850c0d697948bf942fdc9b16ce3a9ae217dcbf1b 100644 (file)
@@ -777,7 +777,7 @@ st_texture_cache_bind_weak_notify (gpointer     data,
 {
   StTextureCachePropertyBind *bind = data;
   bind->weakref_active = FALSE;
-  g_clear_signal_handler (&bind->notify_signal_id, bind->source);
+  g_signal_handler_disconnect (bind->source, bind->notify_signal_id);
 }
 
 static void